﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using _02._07.DataAccessWithAdoNet.Services;

namespace _02._07.DataAccessWithAdoNet
{
    class Program
    {
        static void Main(string[] args)
        {           
            //List<string> categoryNames = NorthwindDAL.GetCategoryNames();
            //Print(categoryNames);

            //var categoryNamesAndProductNames = NorthwindDAL.GetProductNamesForEachCategoryName();
            //PrintCategoryNamesAndProducts(categoryNamesAndProductNames);            

            NorthwindDAL.AddProduct("N,1,1,q,1,1,1,1,1 GO DROP TABLE Products", 1, 1, "q,1,1,1,1,1");
        }

        private static void PrintCategoryNamesAndProducts(List<KeyValuePair<string, string>> categoryNamesAndProductNames)
        {
            Console.WriteLine("{0,-20} {1}", "Category", "Products");

            foreach (KeyValuePair<string, string> pair in categoryNamesAndProductNames)
            {
                Console.WriteLine("{0,-20} {1}", pair.Key, pair.Value);
            }
        }

        private static void Print(List<string> strings)
        {
            foreach (string str in strings)
            {
                Console.WriteLine(str);
            }
        }
    }
}
